home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / gfx / edit / AmiCAD_2.06.lha / AmiCAD / ARexx / Majuscules.amiCAD < prev    next >
Text File  |  2000-04-13  |  2KB  |  65 lines

  1. /* Script ARexx permettant la conversion d'un objet texte en MAJUSCULES
  2.    Chez Corbin, 7 Octobre 1997,  Version 1.00, © R.Florac
  3.         7 Décembre 1997, version 1.01: extension à tous les objets sélectionnés
  4.            13 avril 1998,     version 1.02: ajout SAVEALL
  5.            27 Février 1999,  version 1.03: ajout INIT variable
  6.            13 avril 2000,     version 1.04: adaptation version 2.05
  7. $VER: Majuscules.AmiCAD 1.04 (© R.Florac, 13/04/00) */
  8.  
  9. options results
  10.  
  11. signal on error
  12. signal on syntax
  13.  
  14. 'INIT(OBJET):OBJET=FIRSTSEL'; objet = result
  15. if objet = 0 then do
  16.     'MESSAGE("Il n''y a aucun objet"+CHR(10)+"qui soit sélectionné"):INIT(OBJET)'
  17.     exit
  18. end
  19.  
  20. 'SAVEALL'
  21. do while objet > 0            /* version 1.01 */
  22.     'TYPE(OBJET)'; type = result
  23.     'READTEXT(OBJET)'; texte = result
  24.  
  25.     i = 1
  26.     l = length(texte)
  27.     do while i <= l
  28.  
  29.     curletter = substr(texte, i, 1)
  30.     if curletter = ' ' then
  31.     do
  32.            i = i + 1
  33.            iterate
  34.     end
  35.  
  36.     texte = overlay(upper(curletter), texte, i)
  37.  
  38.     i = i + 1
  39.     end
  40.  
  41.     select
  42.     when type = 4 then 'SETTEXT(OBJET,"'texte'")'
  43.     when type = 5 then 'SETTEXT(OBJET,"'texte'")'
  44.     when type = 6 then 'SETTEXT(OBJET,"'texte'")'
  45.     when type = 11 then 'SETTEXT(OBJET,"'texte'")'
  46.     when type = 12 then 'SETTEXT(OBJET,"'texte'")'
  47.     otherwise nop
  48.     end
  49.  
  50.     'OBJET=NEXTSEL(OBJET)'; objet = result
  51.     if objet=0 then leave
  52. end
  53. 'INIT(OBJET)'
  54. exit
  55.  
  56. /* Traitement des erreurs, interruption du programme */
  57. syntax:
  58. erreur=RC
  59. 'MESSAGE("Script Majuscules.AmiCAD:"+CHR(10)+"Erreur de syntaxe"+CHR(10)+"en ligne 'SIGL'"+CHR(10)+"'errortext(erreur)'"):INIT(OBJET)'
  60. exit
  61.  
  62. error:
  63. 'MESSAGE("Script Majuscules.AmiCAD:"+CHR(10)+"Erreur en ligne 'SIGL'"):INIT(OBJET)'
  64. exit
  65.